home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / exechk.arc / EXECHK.PAS < prev    next >
Pascal/Delphi Source File  |  1990-12-06  |  2KB  |  55 lines

  1. (*******************************************************************
  2. Program/Unit                 EXECHK.TPU
  3. Written                      06 Dec 90
  4. Revised                      .........
  5. Author                       Johnathan J. Stein
  6.                              PO Box 346
  7.                              Perrysburg, OH  43551
  8.                              CompuServe 76576,470
  9. Purpose                      To illustrate how to implement EXE
  10.                              file "stamping", in order to discourage
  11.                              illegal copying WITHOUT using copy protection.
  12. Contents                     1 Function , 2 Procedures
  13.  
  14. Please send comments, suggestions or complaints to the above address.
  15. *******************************************************************)
  16. UNIT exechk ;
  17.  
  18. INTERFACE
  19.  
  20. USES Dos ;
  21.  
  22. function  IsExePersonalized  ( S : string ) : boolean ;
  23. procedure ExeInstallData     ( S : string ; VAR V ; NumBytes : longint ) ;
  24. procedure ExeReadData        ( S : string ; VAR V ; NumBytes : longint ) ;
  25.  
  26. IMPLEMENTATION
  27.  
  28. {$I exechk.doc }                       (* Documentation *)
  29. {$I exechk.def }                       (* EXE header file header info *)
  30. {$I abort.inc }                        (* Global halt, w/message *)
  31. {$I exechk.inc }                       (* File access *)
  32.  
  33. BEGIN
  34.    (*******************************************************************
  35.    NETWORKS & FILE ATTRIBUTES:
  36.    ---------------------------
  37.    To eliminate problems on networks and for when the EXE file attribute
  38.    has the ReadOnly bit set.
  39.  
  40.    If you eliminate this initialization code, you may also remove the
  41.    USES Dos; statement above (it is only used for DosVersion).
  42.    *******************************************************************)
  43.    if Lo ( DosVersion ) >= 3 then
  44.    begin
  45.       DefaultFileMode        := 64 ;             (* Read_DenyNone *)
  46.       DefaultWriteMode       := 66 ;             (* ReadWrite_DenyNone *)
  47.    end
  48.    else
  49.    begin
  50.       DefaultFileMode        := 0 ;              (* Read_Only *)
  51.       DefaultWriteMode       := 2 ;              (* Read_Write *)
  52.    end ;
  53.    FileMode                  := DefaultFileMode ;
  54. END.
  55.